<template>
  <!-- 查看详情 2018/3/7 11:44 zhangQ -->
  <div>
    <Table :columns="subOrderColumn" :data="subOrderList" :height="200"></Table>
  </div>
</template>

<script>
  import {getSubOrderListByGroupId} from '@api/backEnd/station'

  export default {
    name: 'view-detail',
    data () {
      let subOrderList = []
      let subOrderColumn = [
        {
          title: '箱号',
          ellipsis: 'false',
          width: 200,
          render: (h, params) => {
            let containerNo = params.row.containerNoHead + params.row.containerNoBody
            return (<span>{containerNo}</span>)
          }
        },
        {
          title: '送货地址',
          ellipsis: 'false',
          width: 150,
          key: 'shippingAddress'
        },
        {
          title: '发货人',
          ellipsis: 'false',
          key: 'zkfhrmc',
          width: 250
        },
        {
          title: '收货人',
          ellipsis: 'false',
          key: 'zkshrmc',
          width: 250
        },
        {
          title: '联系人',
          ellipsis: 'false',
          width: 100,
          key: 'contacts'
        },
        {
          title: '联系人电话',
          ellipsis: 'false',
          width: 150,
          key: 'contactsMobile'
        },
        {
          title: '品名',
          ellipsis: 'false',
          key: 'zkpmhz0',
          width: 150
        },
        {
          title: '接取送达费(元)',
          ellipsis: 'false',
          key: 'zkjf018',
          width: 120
        }
      ]
      let datas = {subOrderList, subOrderColumn}
      return datas
    },
    props: {
      groupId: {
        type: String,
        default: null
      }
    },
    computed: {},
    methods: {
      getSubOrder () {
        getSubOrderListByGroupId({'groupId': this.groupId}).then(res => {
          if (+res.data.isSuccess === 1) {
            this.subOrderList = res.data.data
          }
        })
      }
    },
    mounted () {
      this.getSubOrder()
    },
    components: {}
  }
</script>
<style scoped>
  .expand-row {
    margin-bottom: 16px;
  }
  .ivu-table{
   overflow: auto;
  }
</style>
